import type { RouteRecordRaw, RouteLocationNormalized } from 'vue-router';

const deckSet: RouteRecordRaw[] = [
  {
    path: '/deckset/:game_id',
    name: 'DeskSetListPage',
    component: () => import('/@/views/deskSet/deckList'),
    meta: {
      title: '套牌广场',
      keepAlive: true,
    },
    props: (router: RouteLocationNormalized) => {
      return {
        gameId: router.params.game_id ? String(router.params?.game_id) : '',
      };
    },
  },
  {
    path: '/setdeckadcard',
    name: 'AdvancedCardPage',
    component: () => import('/@/views/deskSet/advancedCard'),
    meta: {
      title: '高级搜索',
    },
  },
  {
    path: '/setdeckdetail/:deck_id/:game_id?',
    name: 'SetDeckDetailPage',
    component: () => import('/@/views/deskSet/setDeckDetail'),
    meta: {
      title: '套牌详情',
    },
    props: (router: RouteLocationNormalized) => {
      return {
        deckId: router.params.deck_id ? String(router.params?.deck_id) : 0,
        share: router.query.share || '',
        gameId: router.query.gameid || router.params.game_id || '',
      };
    },
  },
  {
    path: '/deckmatchsheet/:game_id?/:deck_id?',
    name: 'MatchSheetPage',
    component: () => import('/@/views/deskSet/matchSheet'),
    meta: {
      title: '比赛表格',
    },
    props: (router: RouteLocationNormalized) => {
      return {
        gameId: router.params.game_id || '',
        deckId: router.params.deck_id ? Number(router.params?.deck_id) : 0,
      };
    },
  },
];

export default deckSet;
